#ifndef CASTAR_H_PRIVATE_INCLUDED_
#define CASTAR_H_PRIVATE_INCLUDED_

extern int UNIT_SIZE;

extern char TERRAIN_PASSABLE_CHAR;
extern char TERRAIN_IMPASSABLE_CHAR;
extern char TERRAIN_SOME_WHAT_PASSABLE_CHAR;
extern char PATH_CHAR;

extern int isInited;
extern int isFreed;

typedef struct {

	int size;
	Node** nodePositionHash;

} NodeList;

typedef struct {
	int size;
	Node* neighbors[8];

} Neighbors;

typedef struct {

	Node** nodes;

} Nodes;

extern Nodes nodes;
extern NodeList openList, closedList; //list[areaWidth*areaHeight]
extern Neighbors neighbors;

void CAStar_private_List_add(NodeList* nodeList, Node* n);
void CAStar_private_List_remove(NodeList* nodeList, int x, int y);
Node* CAStar_private_List_getFirst(NodeList* nodeList);
Node* CAStar_private_List_searchByPosition(NodeList* nodeList, int x, int y);
Node* CAStar_private_List_getLowestFNode();//from openList

void CAStar_private_processSucessors(Node* currentNode, Node* finish, int somewhatPassableGAddendum);

void CAStar_private_addParent(Node* child, Node* parent);
int CAStar_private_Node_equals(Node* n1, Node* n2);
double CAStar_private_getDistance(Node* n1, Node* n2);
void CAStar_private_calculateNeighbors(Node* node);
double CAStar_private_getF(Node* node);

char* CAStar_private_Area_toString();

#endif
